﻿namespace com.stifel.Exceptions.SharePointExceptions
{
    using System;

    [Serializable]
    public class FeatureActivationFailedNotScopedForSiteException : Exception
    {
        #region Constructors

        /// <summary>
        /// The feature activation failed. The feature is not scoped for Site.
        /// </summary>
        public FeatureActivationFailedNotScopedForSiteException( )
            : base(GetMessage( ))
        {
        }

        /// <summary>
        /// The feature activation failed. The feature is not scoped for Site. The specified feature was not successfully activated.
        /// </summary>
        /// <param name="featureId"></param>
        /// <param name="title"></param>
        /// <param name="url"></param>
        public FeatureActivationFailedNotScopedForSiteException( Guid featureId, string title, string url )
            : base(GetMessage( featureId, title, url ))
        {
        }

        #endregion Constructors

        #region Methods

        public static string GetMessage( )
        {
            return "The feature activation failed. The feature is not scoped for Site.";
        }

        public static string GetMessage( Guid featureId, string title, string url )
        {
            return string.Format( "The feature activation failed. The feature is not scoped for Site. The specified feature {0} ({1}) was not successfully activated at '{2}'.", featureId, title, url );
        }

        #endregion Methods
    }
}